-
-
Notifications
You must be signed in to change notification settings - Fork 100
Add Standard Schema adapter #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- My IDE also sorted the imports
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Great work on this, I couldn't add it to the latest release unfortunately, too much in the backlog! I'm also curious if the |
- Updated `_standard` function to use `RequiredDefaultsOptions`
That's a good idea. Arktype is one of the compatible libraries, so if it requires defaults, then the standard schema should too. It is also possible to tell either at runtime or in the types which vendor it is: // type
T['~standard`]['vendor'] extends "arktype"
// runtime
schema['~standard'].vendor === "arktype" |
Any updates on this? Protovalidate, mentioned in #615, does implement the standard schema, so this would solve that issue and also provide a more generic entrypoint since it's impossible as of now to have a customized adapter |
https://standardschema.dev/
Standard Schema is a common interface designed to be implemented by JavaScript and TypeScript schema libraries.
The goal is to make it easier for ecosystem tools to accept user-defined type validators, without needing to write custom logic or adapters for each supported library. And since Standard Schema is a specification, they can do so with no additional runtime dependencies. Integrate once, validate anywhere.
What schema libraries implement the spec?
These are the libraries that have already implemented the Standard Schema interface. (If you maintain a library that implements the spec, create a PR to add yourself!)